<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="po.User" %>
<%@ page import="dao.impl.UserDaoImpl" %>
<%@ page import="dao.UserDao" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>处理注册</title>
</head>
<body>
    <%
        User user=new User();
        String name=request.getParameter("rename");
        String password=request.getParameter("repassword");

        user.setUsername(name);
        user.setPassword(password);
        System.out.println("111");
        UserDao dao=new UserDaoImpl();
        boolean flag=dao.register(user);
        if(flag){
            response.sendRedirect("login.jsp");
            System.out.println("222");
        }else{
            response.sendRedirect("registerFail.jsp");
            System.out.println("333");
        }
    %>
</body>
</html>
